/**
 * 素材库
 */
export interface AssetLibrary {
  id: string;
  name: string;
  type: string;
  categories: AssetCategory[];
  assets: Asset[];
  createdAt: Date | string;
  updatedAt: Date | string;
  ownerId?: string;
  isPublic?: boolean;
  localPath?: string;
}

/**
 * 素材分类
 */
export interface AssetCategory {
  id: string;
  name: string;
  parentId?: string;
  libraryId: string;
  icon?: string;
  order: number;
  assetCount: number;
}

/**
 * 素材
 */
export interface Asset {
  id: string;
  name: string;
  type: string;
  categoryId: string;
  libraryId: string;
  creatorId?: string;
  thumbnail?: string;
  previewUrl?: string;
  fileUrl?: string;
  localPath?: string;
  fileSize?: number;
  metadata?: AssetMetadata;
  tags?: string[];
  createdAt: Date | string;
  updatedAt: Date | string;
  downloadCount?: number;
  rating?: number;
  price?: number;
  isPremium: boolean;
  license: string;
  status?: string;
}

/**
 * 素材元数据
 */
export interface AssetMetadata {
  dimensions?: Dimensions;
  duration?: number;
  format?: string;
  frameRate?: number;
  sampleRate?: number;
  channels?: number;
  bitrate?: number;
  colorSpace?: string;
  description?: string;
  author?: string;
  copyright?: string;
  customProperties?: Record<string, any>;
}

/**
 * 尺寸
 */
export interface Dimensions {
  width: number;
  height: number;
  depth?: number;
  unit?: string;
}

/**
 * 素材包
 */
export interface AssetPack {
  id: string;
  name: string;
  description?: string;
  thumbnail?: string;
  creatorId: string;
  assets: string[];
  price: number;
  discountPrice?: number;
  createdAt: Date | string;
  updatedAt: Date | string;
  purchaseCount: number;
  rating?: number;
  tags?: string[];
  status: string;
}

/**
 * 素材购买记录
 */
export interface AssetPurchase {
  id: string;
  userId: string;
  assetId?: string;
  assetPackId?: string;
  price: number;
  purchaseDate: Date | string;
  paymentMethod: string;
  transactionId: string;
  status: string;
  creatorEarnings: number;
  platformFee: number;
}

/**
 * 插件
 */
export interface Plugin {
  id: string;
  name: string;
  version: string;
  description: string;
  author: string;
  homepage?: string;
  repository?: string;
  icon?: string;
  entryPoint: string;
  permissions: string[];
  dependencies?: Record<string, string>;
  isActive: boolean;
  isBuiltIn: boolean;
  installDate: Date | string;
  lastUpdated?: Date | string;
  price?: number;
  rating?: number;
  downloadCount?: number;
  category: string;
  tags?: string[];
  minAppVersion: string;
  maxAppVersion?: string;
}

/**
 * 插件设置
 */
export interface PluginSetting {
  pluginId: string;
  userId: string;
  settings: Record<string, any>;
  lastUpdated: Date | string;
}

/**
 * 插件扩展点
 */
export interface PluginExtension {
  id: string;
  pluginId: string;
  type: string;
  target: string;
  priority: number;
  data: Record<string, any>;
  isEnabled: boolean;
}

/**
 * 插件市场项目
 */
export interface PluginMarketItem {
  id: string;
  pluginId: string;
  name: string;
  description: string;
  version: string;
  author: string;
  publisherId: string;
  publishDate: Date | string;
  lastUpdate: Date | string;
  price: number;
  discountPrice?: number;
  screenshots?: string[];
  category: string;
  tags?: string[];
  rating?: number;
  ratingCount?: number;
  downloadCount: number;
  featured: boolean;
  verified: boolean;
  status: string;
}

/**
 * 素材库响应
 */
export interface AssetLibraryResponse {
  success: boolean;
  library?: AssetLibrary;
  message?: string;
}

/**
 * 素材库列表响应
 */
export interface AssetLibraryListResponse {
  success: boolean;
  libraries?: AssetLibrary[];
  message?: string;
}

/**
 * 素材响应
 */
export interface AssetResponse {
  success: boolean;
  asset?: Asset;
  message?: string;
}

/**
 * 素材列表响应
 */
export interface AssetListResponse {
  success: boolean;
  assets?: Asset[];
  total?: number;
  page?: number;
  pageSize?: number;
  message?: string;
}

/**
 * 插件响应
 */
export interface PluginResponse {
  success: boolean;
  plugin?: Plugin;
  message?: string;
}

/**
 * 插件列表响应
 */
export interface PluginListResponse {
  success: boolean;
  plugins?: Plugin[];
  total?: number;
  page?: number;
  pageSize?: number;
  message?: string;
}

/**
 * 购买素材请求
 */
export interface PurchaseAssetRequest {
  assetId?: string;
  assetPackId?: string;
  paymentMethod: string;
}

/**
 * 购买素材响应
 */
export interface PurchaseAssetResponse {
  success: boolean;
  purchaseId?: string;
  message?: string;
}

/**
 * 下载素材响应
 */
export interface DownloadAssetResponse {
  success: boolean;
  localPath?: string;
  message?: string;
} 